# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit unpacker xdg

DESCRIPTION="YOZO Office The Linux Version"
HOMEPAGE="https://www.yozosoft.com/home.htm"
SRC_URI="http://www.yozosoft.com/download/${PN}_${PV}ZH.S1_amd64.deb"

LICENSE=""
SLOT="0"

RESTRICT="strip mirror" # mirror as explained at bug #547372
KEYWORDS="~amd64"
IUSE=""

DEPEND="
	x11-libs/libXtst
	x11-libs/libXt
"
RDEPEND="${DEPEND}"
BDEPEND=""

S="${WORKDIR}"

PATCHES=(
	"${FILESDIR}/${P}-fix-desktop.patch"
	"${FILESDIR}/${P}-add-comment-desktop.patch"
) 

src_install() {
	exeinto /usr/bin
	exeopts -m0755
	doexe "${S}"/usr/bin/yozo
	doexe "${S}"/usr/bin/yozoc
	doexe "${S}"/usr/bin/yozoi
	doexe "${S}"/usr/bin/yozow
	
	insinto /usr/share
	doins -r ${S}/usr/share/{applications,fonts,icons,mime,mime-info,mimelnk,yozofileicon}

	insinto /etc
	doins -r ${S}/etc/{Yozosoft,yozoXpack}

	insinto /opt/Yozosoft
	doins -r ${S}/opt/Yozosoft/Yozo_Office

	fperms 0755 /opt/Yozosoft/Yozo_Office/*.bin
	fperms 0755 /opt/Yozosoft/Yozo_Office/System/.link
}
